package com.iptv.grape.jss.impls;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class ImplFactory {
    public static ImplFactory implFactory;

    public static ImplFactory istc() {
        if (null == implFactory)
            synchronized (ImplFactory.class) {
                if (null == implFactory)
                    implFactory = new ImplFactory();

            }
        return implFactory;
    }

    private Map<String, Object> maps = new ConcurrentHashMap<>();

    private InitPro initPro;

    public void addInitPro(InitPro initPro) {
        this.initPro = initPro;
        maps.put("initPro", initPro);
    }

    public void setInitPro(int size, int pro) {
        if (initPro != null)
            initPro.initPro(size, pro);
    }


    private ProCall proCall;

    public void addProCall(ProCall proCall) {
        this.proCall = proCall;
        maps.put("proCall", proCall);
    }

    public void setProCall(int pro) {
        if (null != proCall) {
            proCall.setPro(pro);
        }
    }
    public void setProCallStart() {
        if (null != proCall) {
            proCall.setSartPro();
        }
    }


}
